<?php

defined('SYSPATH') or die('Access error!');

class Controller_Welcome extends Controller_Main
{

    public function action_index()
    {
        $news = Model::factory('news');
        //获取分类
        $category_list = $this->get_date_as_array(NEWS_CATEGORY_ID, 'news');
        $this->template->assign('category_list', $category_list);
        //最新资讯
        $news_list = $news->get_allnews_list(NEWS_CATEGORY_ID, 5);
        $this->template->assign('news_list', $news_list);
        //求职宝典
        $job_new_book = $news->get_allnews_list(24, 5);
        $this->template->assign('job_new_book', $job_new_book);
        //面试技巧
        $interview_skills = $news->get_news_list(array('category_id' => 13));
        $this->template->assign('interview_skills', $interview_skills);
        //面试题
        $interview_problems = $news->get_news_list(array('category_id' => 14));
        $this->template->assign('interview_problems', $interview_problems);
        //笔试技巧
        $written_skills = $news->get_news_list(array('category_id' => 19));
        $this->template->assign('written_skills', $written_skills);
        //笔试题文章
        $written_problems = $news->get_news_list(array('category_id' => 18));
        $this->template->assign('written_problems', $written_problems);
        //初涉职场
        $first_job = $news->get_news_list(array('category_id' => 34));
        $this->template->assign('first_job', $first_job);
        //职场故事
        $job_story = $news->get_news_list(array('category_id' => 22));
        $this->template->assign('job_story', $job_story);
        
        
        //首页下面书籍
        $job_bottom_book = $news->get_allnews_list(24, 12);
        $this->template->assign('job_bottom_book', $job_bottom_book);
        
        //首页下面服饰
        $clothes_bottom_book = $news->get_allnews_list(30, 12);
        $this->template->assign('clothes_bottom_book', $clothes_bottom_book);
        
        
        $this->template->view('index');
    }

}
